/*
 * Copyright (C) 2004-2016 7dub.cn All rights reserved Author: caozhongsheng
 * Date: 2016年11月12日
 */
package cn.dub.scarecrow.web.controller;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import cn.dub.scarecrow.common.entity.User;
import cn.dub.scarecrow.service.IActivityService;

@RequestMapping("/activity")
@Controller
public class ActivityController extends BaseController {

    @Resource
    private IActivityService actService;

    @RequestMapping(value = "/shuffle", method = RequestMethod.GET)
    @ResponseBody
    public User shuffle() {
        return this.actService.getUserById(1);
    }

    @RequestMapping("/demo")
    public String hello(Model model) {
        model.addAttribute("user", this.actService.getUserById(1));
        return "demo";
    }

}
